.so ../bk-macros
.TH "bk parent" "\*[BKVER]" %E% "\*(BC" "\*(UM"
.SH NAME
bk parent \- manage repository parent pointer[s]
.SH SYNOPSIS
.B bk parent
[\c
.Bc \-a
\||\|\c
.Bc \-r
\||\|\c
.BR \-s ]
.[B] \-1iloq
.[ARG] repository
.[ARG] repository
.SS SETTING PARENT POINTERS
.B bk parent \-s 
.[B] \-ioq
.ARG repository
.[ARG] repository
.br
.SS ADDING PARENT POINTERS
.B bk parent \-a 
.[B] \-ioq
.ARG repository
.[ARG] repository
.br
.SS REMOVING PARENT POINTERS
.B bk parent \-r 
.[B] \-ioq
.ARG repository
.[ARG] repository
.br
.SS LISTING PARENT POINTERS
.B bk parent
.[B] \-1iloq
.SH DESCRIPTION
The 
.B bk parent
command is used to set, add, adjust,
remove or list parent pointers for a repository.
A parent pointer is a \*[BK] URL which is the location from or
to which  a repository gets or sends updates when running
.B bk pull
or
.BR "bk push" .
The typical case is that a repository has only one ``parent''
but it is possible for a repository to have multiple parent
pointers and each pointer may be incoming, outgoing, or both.
.LP
When setting the parent pointer, the parent command is backwards compatible
with earlier versions if and only if there is currently no parent pointer
or there is one and only one push/pull parent pointer.  
.LP
The parent is automatically set when a repository is cloned and will be
named according to the access method (see
.B bk help url
for more information).
.SH OPTIONS
.TP
.B \-1
List only the first parent found.  
May be combined with
.Q \-i
or
.Q \-o 
to list the first incoming or outgoing parent pointer[s] respectively.
.tp
.B \-a
Add the specified parent pointer to the list of parents.
May be combined with
.Q \-i
or
.Q \-o
to add just the incoming or outgoing parent pointer[s] respectively.
.tp
.B \-i
Operate only on incoming (pull) parent pointers.  May be used when
setting, adding, adjusting, removing, or listing parents.
.tp
.B \-l
List the parent pointer[s] without any annotations, one per line.
May be combined with
.Q \-i
or
.Q \-o
to list just the incoming or outgoing parents respectively.
.tp
.B \-o
Operate only on outgoing (push) parent pointers.  May be used when
setting, adding, adjusting, removing, or listing parents.
.tp
.B \-q
Do not produce output when adding/removing/listing parents.
May be combined with
.Q \-i
or 
.Q \-o
to query whether the repository has an incoming (pull) or outgoing (push)
parent pointer, exit status will be 0 if any matching parent pointers where
found, otherwise exit status is 1.
.tp
.B \-r
Remove the parent pointer.
May be combined with
.Q \-i
or
.Q \-o
to remove just the incoming or outgoing parent pointer[s] respectively.
Using 
.Q \-i
or
.Q \-o
on a bidirectional parent pointer converts the parent pointer to unidirectional.
.tp
.B \-s
Set the parent pointer[s] to the specified list, replacing any existing 
pointers.  This option is always required to override any existing parent
pointers
except in the case that there is only one bidirectional parent pointer and it
is being replaced with one bidirectional parent pointer (backwards compat).
.SH BUGS
The term parent is somewhat of a misnomer in a peer to peer system.
Since it is quite common to use \*[BK] repositories  in a
parent/child relationship most of the time, we have stuck with
the term.
.SH "SEE ALSO"
.SA bkd
.SA changes
.SA clone
.SA pull
.SA push
.SA url
.SH CATEGORY
.B Repository
